package com.zhu.transaction.pojo;

import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.util.StringUtils;

/**
 * @author Zhu
 * @createtime 2021/2/2-8:20
 */
@Data
@ToString
@Accessors(chain = true)
public class ProductCondition {
    String categoryId = "0";
    Integer curPage = 0;
    Float minPrice;
    Float maxPrice;
    String releaseTimeRange;
    String productName;
    Boolean ajaxQuest = false;

    public String getEarlyTime() {
        String earlyTime = null;
        if (!StringUtils.isEmpty(this.releaseTimeRange)) {
            String[] times = this.releaseTimeRange.split(" - ");
            earlyTime = times[0];
        }
        return earlyTime;
    }

    public String getLastTime() {
        String lastTime = null;
        if (!StringUtils.isEmpty(this.releaseTimeRange)) {
            String[] times = this.releaseTimeRange.split(" - ");
            lastTime = times[1];
        }
        return lastTime;
    }
}
